Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sqlite3_serialize() and sqlite3_deserialize() (src) #536

Closed
wants to merge 1 commit into from

Conversation

garthmz
Copy link

@garthmz garthmz commented Jan 24, 2023

Opening this PR for discussion. I'm not sure about the approach, or if there are additional requirements to get a change like this accepted.

The raw additions seem heavy compared to its other methods, but I tried to take a similar stance of handling all memory management there. Since the sqlite flags for these functions are related to memory management, they are not exposed in the raw api. The support for Stream is a simple, standard way to avoid a buffer, but it is a new reference to System.IO.

@ericsink
Copy link
Owner

ericsink commented Feb 6, 2023

From an initial read, this is nice work. Thanks for submitting it. I may still have feedback or requested changes when I go through it more closely, which I hope to get done soon.

@ericsink
Copy link
Owner

Sorry for the long delay in reviewing this.

  1. In principle, I have to push back on the use of System.IO.Stream. Anything that high-level is usually omitted from this library, with the expectation that upper layers will provide it.

  2. I'm staring at the deserialize call that accepts a ReadOnlySpan and then allocates a block and copies it. That just feels wrong. I haven't actually used the sqlite3_deserialize() API, so I've been reading the docs, and I sort of see why you did things this way. But it raises questions as I look at the code.

  3. Once we get the code looking okay for merge, I'll be asking for this PR to include test cases.

@ericsink
Copy link
Owner

See #547

@ericsink ericsink closed this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants